package main

import "fmt"

//有一条船，船上有35个人，船超载，船最多容纳20个人，就要有15个人下船
//给每一个人一个从1开始的编号，每次数到第9个就下船，问最后下船的是哪些编号
//下船-》9，18，27，1，11......

func main() {
	num := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}
	count := -1
	fmt.Println("下船的编号为：")
	for i := 0; i < 15; i++ {
		if len(num)-count-1 < 9 {
			count = count + 9 - len(num)
		} else {
			count = count + 9
		}
		fmt.Print(num[count], ",")
		num = append(num[:count], num[count+1:]...)
		//fmt.Println(num)
		count--
	}
}
